﻿function LoadConfigFile(fileName){
	if(fileName==undefined){
		fileName="config.txt";
	}
	trace("load config ["+fileName+"]");
	var cff=new File(fileName);
	if(!cff.exists){
		cff.open("utf8","create");
		cff.flush();
		cff.close();
		cff=new File(fileName);
	}
	cff.open("text","read");
	var configs=new Object();
	while(!cff.eof()){
		var l=cff.readln();
		trace(l);
		if(l.indexOf("//")!=0 && l.length>0 && l.indexOf("=")>-1){
			var namev=l.split("=");
			configs[namev[0]]=namev[1];
		}
	}
	cff.close();
	
	MyTrace(configs)
	return configs;
}